﻿/**
 * Author:
 *				Đỗ Việt Hoà
 * Copyright (c) 2012 Đỗ Việt Hoà <vit@launchar.com>.
 * 
 * This file is part of Launchar.
 * 
 * Launchar is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Launchar is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Launchar.  If not, see <http://www.gnu.org/licenses/>.
 */

using System.Xml;
using vIT.Web.Configuration;

namespace vIT.LBee.Web.Configuration
{
	/// <summary>
	/// Configuration of membership.
	/// </summary>
	public class MembershipConfig
	{
		#region Attributes

		/// <summary>
		/// Gets the string value that is the name of the membership provider.
		/// </summary>
		public string ProviderName { get; private set; }

		#endregion

		#region Constructor

		/// <summary>
		/// Initializes a new instance of <see cref="vIT.LBee.Web.Configuration.MembershipConfig"/> class.
		/// </summary>
		public MembershipConfig(XmlNode xml)
		{
			var cfg = WebConfig.Membership;
			this.ProviderName = ((xml == null || xml.Attributes["providerName"] == null) ? cfg.DefaultProvider : xml.Attributes["providerName"].Value);
		}

		#endregion
	}
}
